<template>
  <el-card>
    <div style="text-align: center">{{ title }}</div>
    <!--      <div>时间</div>-->
    <div>
      <div v-html="content"></div>
    </div>
  </el-card>
</template>

<script>
// import AddConfigure from "./AddConfigure.vue";
// import AddContent from "./AddContent.vue";
// import AddAnnexes from "./AddAnnexes.vue";
// import { getModuleListApi } from "@/api/modules/modules.api";
//
// import { insertArticleApi } from '@/api/modules/article.api'
// import { quillEditor } from "vue-quill-editor";

export default {
  // components: {
  //   quillEditor,
  // },
  props: ["previewsObj"],
  data() {
    return {
      visible: false,
      active: 0,
      moduleList: [],
      form: {},
      content: "",
      title: "",
      placeholder: "",
      editorOptions: {
        modules: {
          toolbar: false, // 将 toolbar 设置为 false 隐藏工具栏
        },
        placeholder: "",
        readOnly: true,
      },
    };
  },
  watch: {
    previewsObj(val) {
      this.content = val.content;
      this.title = val.name;
    },
  },
  methods: {
    focus(event) {
      event.enable(false);
    },
    onEditorBlur(v) {
      v.enable(!this.disabled);
    },
    // async handleAdd() {
    //   const configureObj = this.$refs.configure.getContent()
    //   const contentObj = this.$refs.content.getContent()
    //   const annexesObj = this.$refs.annexes.getContent()
    //   const obj = {
    //     ...configureObj,
    //     content: contentObj,
    //     fileList: configureObj.fileList.concat(annexesObj),
    //     status: 1
    //   }
    //   console.log(' obj.checkedCities',  obj)
    //   obj.boldFlag = obj.checkedCities?.includes('加粗')
    //   obj.topFlag = obj.checkedCities?.includes('置顶')
    //   obj.pushSchool = obj.checkedCities?.includes('推送学校')
    //   obj.outChainFlag = obj.outChainFlag === '0'
    //   delete obj.checkedCities
    //   await insertArticleApi(obj)
    // },
    // async handleSave() {
    //   const configureObj = this.$refs.configure.getContent()
    //   const contentObj = this.$refs.content.getContent()
    //   const annexesObj = this.$refs.annexes.getContent()
    //   const obj = {
    //     ...configureObj,
    //     content: contentObj,
    //     fileList: configureObj.fileList.concat(annexesObj),
    //     status: 0
    //   }
    //   obj.boldFlag = obj.checkedCities.include('加粗')
    //   obj.topFlag = obj.checkedCities.include('置顶')
    //   obj.pushSchool = obj.checkedCities.include('推送学校')
    //   obj.outChainFlag = obj.outChainFlag === '0'
    //   delete obj.checkedCities
    //   await insertArticleApi(obj)
    //   this.$message({
    //     message: '成功',
    //     type: 'success'
    //   });
    // },
    // async getTableData({...data}){
    //   const item = await getModuleListApi({ ...data })
    //   console.log(item)
    //   this.moduleList = item
    // }
  },
};
</script>
<style scoped>
/deep/ .ql-container.ql-snow {
  border: none;
}
</style>
